from django.db import models
from person.models import Person


# Create your models here.
class Conference(models.Model):
    id = models.AutoField(primary_key=True)
    preset_time = models.DateTimeField(blank=True, null=True)  # 会议时间
    place = models.CharField(max_length=255, blank=True, null=True)  # 会议地点
    number = models.IntegerField(blank=True, null=True)  # 会议期次
    host = models.ForeignKey( # 报道人
        Person,
        on_delete=models.CASCADE,
        related_name="conference",
        blank=True,
        null=True,
    )

    class ConferenceType(models.TextChoices):  # 会议类型
        EXECUTIVE = "常务会议"
        PLENARY = "全体会议"
        OFFICE = "办公会议"
        SPECIAL = "专题会议"
        PARTY = "党务会议"
        WORKING = "工作会议"

    type = models.CharField(
        max_length=12,
        choices=ConferenceType.choices,
        default=ConferenceType.EXECUTIVE,
        blank=True,
        null=True,
    )
    title = models.CharField(max_length=255, blank=True, null=True)
    content = models.FileField(
        upload_to="download/Conference/content", blank=True, null=True
    )

    proposal = models.CharField(max_length=255, blank=True, null=True)  # 建议
    notice = models.TextField(blank=True, null=True)  # 会议通知
    plan = models.FileField(
        upload_to="download/Conference/plan", blank=True, null=True
    )  # 会议方案
    shenbao_time=models.DateTimeField(blank=True, null=True)  # 会议时间
    fabu_shijian=models.DateTimeField(blank=True, null=True)  # 会议时间